// Person
class Person {
  constructor(name) {
    this.name = name;
  }

  eat(food) {
    console.log(`${this.name} eat ${food}`);
  }
}

class Children extends Person {
  constructor(name, age) {
    super(name);
    this.age = age;
  }

  getAge() {
    console.log(`${this.name} age is ${this.age}`);
  }
}

let xialuo = new Children('夏洛', 18);
xialuo.getAge();
xialuo.eat('蛋蛋');

// 实例的隐式原型 __proto__ 指向 构造函数的显示原型
console.log(xialuo.__proto__ === Children.prototype);
console.log(Children.__proto__ === Person.prototype);

// console.log(xialuo instanceof Children);
// console.log(xialuo instanceof Person);
// console.log(xialuo instanceof Object);
